/**
 * Created with JetBrains WebStorm.
 * User: Eric
 * Date: 03/02/13
 * Time: 03:49
 * To change this template use File | Settings | File Templates.
 */

//https://github.com/caolan/forms
var translator = require("../Util/translator");
var forms = require('forms'),
    fields = forms.fields,
    widgets = forms.widgets,
    validators = forms.validators;

var loginForm = forms.create({
    email: fields.email({required: true}),
    password: fields.password({required: true})
});

var registerForm = forms.create({
    lastname: fields.string({required: true}),
    firstname: fields.string({required: true}),
    pseudo: fields.string({required: true, rangelength:[4,40]}),
    email: fields.email({required: true}),
    password: fields.password({required: true,rangelength:[8,255]}),
    confirm:  fields.password({
        required: true,
        validators: [validators.matchField('password')]
    })
})


var resetPasswordForm = forms.create({
    email: fields.email({required: true})
});

var passwordRedefinitionForm = forms.create({
    password: fields.password({required: true,rangelength:[8,255]}),
    confirm:  fields.password({
        required: true,
        validators: [validators.matchField('password')]
    })
});


var createPersonageForm = forms.create({

    name: fields.string({required: true}),

    difficulty: fields.string({
        choices: {
            easy: 'Easy',
            medium: 'Medium',
            hard: 'Hard'
        },
        widget: widgets.select()
    })
});

var administrationForm = forms.create({
    Money: fields.string({required: true, label:"Monnaie de départ"})


  /*  Name : fields.string({
        choices: {
            fork: 'Fork',
            baseball: 'Baseball Bat',
            chainsaw: 'Chainsaw',
            Ak47: 'Ak-47'
        },label :'Arme',
        widget: widgets.select()
    }),


    Id : fields.string({
        widget: widgets.hidden()
    })
    Price : fields.string({required : true, label:"Prix"}),
    Damage : fields.string({required : true, label:"Dégâts"}),
    Cadence : fields.string({required : true, label:"Cadence"}),
    Precision : fields.string({required:true, label:"Précision"}),
    Requirement : fields.string({required:true, label:"Requirement"})*/
});



exports.createPersonageForm= createPersonageForm;
exports.loginForm = loginForm;
exports.registerForm = registerForm;
exports.resetPasswordForm = resetPasswordForm;
exports.passwordRedefinitionForm = passwordRedefinitionForm;
exports.administrationForm = administrationForm;


